import request from '@/utils/request'

export default {

    // 添加课程基本信息
    queryCourseInfo(courseInfoVo) {
        return request({
            url: `/eduservice/course/queryCourseInfo`,
            method: 'post',
            data: courseInfoVo
        })
    },

    // 根据课程id查询课程基本信息
    queryCourseInfoByCourseId(courseId) {
        return request({
            url: `/eduservice/course/queryCourseInfoByCourseId/${courseId}`,
            method: 'get'
        })
    },

    // 更新课程基本信息
    updateCourseInfoByCourseId(courseInfoVo) {
        return request({
            url: `/eduservice/course/updateCourseInfoByCourseId`,
            method: 'put',
            data: courseInfoVo
        })
    },

    // 根据课程id获取课程最终发布数据
    queryCoursePublishInfoById(id) {
        return request({
            url: `/eduservice/course/queryCoursePublishInfoById/${id}`,
            method: 'get'
        })
    },

    // 根据课程id修改课程状态
    updateCourseStatusById(id) {
        return request({
            url: `/eduservice/course/updateCourseStatusById/${id}`,
            method: 'put'
        })
    },

    // 课程列表带分页
    queryCoursePage(current, limit, courseQuery) {
        return request({
            url: `/eduservice/course/queryCoursePage/${current}/${limit}`,
            method: 'post',
            data: courseQuery
        })
    },

    // 根据id删除课程
    deleteCourseById(id) {
        return request({
            url: `/eduservice/course/deleteCourseById/${id}`,
            method: 'delete'
        })
    }

}